function curry (...args) {
  const target = (...args1) => {
    // console.log(args);
    return curry(...args, ...args1)
  };
  target.getvalue = () => {
    let sum = 0
    args.forEach((item) => {
      sum += item
    })
    // return args.reduce((p, n) => p + n, 0)
    return sum
  };
  return target
}

let addOne = curry(1)

console.log(addOne(2).getvalue())
console.log(addOne(2).getvalue())